package com.victor9ac.mashup.api;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;



/**
 * wrapper of comment pojo
 * @author victor9ac
 *
 */
public class Commentaries implements Iterable<Comment>{

	List<Comment> commetaries;
	
	
	public Commentaries() {
		commetaries = new ArrayList<Comment>();
	}
	
	public boolean add(Comment comment){
		return comment != null ? commetaries.add(comment) : false;
	}

	
	public Iterator<Comment> iterator() {
		return commetaries.iterator();
	}
	
	
	
	public List<Comment> getCommetaries() {
		return commetaries;
	}

	public void setCommetaries(List<Comment> commetaries) {
		this.commetaries = commetaries;
	}

	public String toString(){
		String str ="";
		for (Comment comment : commetaries) {
			str+=comment.toString()+"\n"; 
		}
		return str;
	}	
}
